package cn.yuanqiao.archive.detection.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 检测详情对象 BJYQ_YQ_INSPECTION_RECORDS_FAIL_DETAILS
 *
 * @author xy
 * @date 2023-08-10
 */
public class DetailLogs extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String BIGTABLENAME = "_YQ_INSPECTION_RECORDS_FAIL_DETAILS";

    public DetailLogs() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
          //  throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }


    /** id */
    @IdAnnotation
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long id;

    /** 记录Id */
    @Excel(name = "记录Id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long pId;

    /** 详情 */
    @Excel(name = "详情")
    private String message;

    /** 检测时间 */
    @Excel(name = "检测时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date detectionTime;

    /** 档号 */
    @Excel(name = "档号")
    private String checkDh;

    /** 档号 */
    @Excel(name = "档号")
    private String checkParentDh;

    /** 检测类型 */
    private String checkType;

    /** dId */
    @Excel(name = "dId")
    private Long dId;

    private String tableName;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setpId(Long pId)
    {
        this.pId = pId;
    }

    public Long getpId()
    {
        return pId;
    }
    public void setMessage(String message)
    {
        this.message = message;
    }

    public String getMessage()
    {
        return message;
    }
    public void setDetectionTime(Date detectionTime)
    {
        this.detectionTime = detectionTime;
    }

    public Date getDetectionTime()
    {
        return detectionTime;
    }
    public void setCheckDh(String checkDh)
    {
        this.checkDh = checkDh;
    }

    public String getCheckDh()
    {
        return checkDh;
    }
    public void setCheckParentDh(String checkParentDh)
    {
        this.checkParentDh = checkParentDh;
    }

    public String getCheckParentDh()
    {
        return checkParentDh;
    }
    public void setCheckType(String checkType)
    {
        this.checkType = checkType;
    }

    public String getCheckType()
    {
        return checkType;
    }
    public void setdId(Long dId)
    {
        this.dId = dId;
    }

    public Long getdId()
    {
        return dId;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("pId", getpId())
            .append("message", getMessage())
            .append("detectionTime", getDetectionTime())
            .append("checkDh", getCheckDh())
            .append("checkParentDh", getCheckParentDh())
            .append("checkType", getCheckType())
            .append("dId", getdId())
            .toString();
    }
}
